home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr05
/
xnot12a.zip
/
JAM.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-16
|
9KB
|
310 lines
/* This header defines both enhancements to emacs (ie. the gnu-like
* behavior of preloading the current file's path into the cmd line
* when opening a new file) and contants which allow emacs to run
* under MS Windows (3.1 and NT) or X11 as if the window were a
* terminal. Minimal window-awareness was added; simple mouse support for
* setting insert point, setting mark, resizing via mode line, select of a
* region, scrolling and shortcuts to dir functions as well as basic
* clipboard (text only) support for MSW platforms. Also, simple printing can
* be supported on MSW by defining DOPRINT in this file. Drag&drop is also
* supported for MSW.
*/
/* Various defines for the message boxes, etc
*/
#define AppName "notgnu"
#define AppQuestion "notgnu Question"
#define AppMsg "notgnu Message"
#define AppJob "notgnu Subtask"
/* wwwwwwwwwwwwwwwwwwwwwww Windows 3.1 / NT wwwwwwwwwwwwwwwwwwwwwwwwwww
*/
# ifdef MSW
# include <windows.h>
# include "string.h"
# define HUGE far
# define FAT /* DOS FILESYSTEM STUFF, ie no native filesystem
support for NT at this time; only FAT */
# ifndef F_OK
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
# endif
# define WINDOWED /* windowed terminal device */
# /* define DOPRINT simple print for MSW only */
# define NROW 300 /* Max Rows. */
# define NCOL 200 /* Max Columns. */
# ifdef SLOWSERVER
# ifndef WIN32 /* 64k seg limit */
# undef NROW
# undef NCOL
# define NROW 50 /* Max Rows. */
# define NCOL 100 /* Max Columns. */
# endif
# endif
/* For vertical scrollbar, define this (never completed!)
*/
# if 0
# define VBAR
# endif
/* For blinking window's cursor, define this
*/
# if 1
# define WINDOWS_CURSOR
# endif
/* For silly spinning cursor during make
*/
#if 0 /* see me.rc if you change this!!! */
# define DOGRINDER
#endif
# define FONTSIZE 14 /* default size in pixels */
# define TIME_INC (130)
# define INCS_PER_UPDATE 10 /* used for window title update */
# define INCS_PER_SEC 8
# define INCS_PER_SLEEP 4 /* used by sleep */
# define INCS_PER_SAVE (INCS_PER_SEC * 6) /* IncrementalSave every ~N secs */
# define SAVE_DELAY INCS_PER_SAVE
# define DELAY_TO_SCROLL 0 /* fast as possible */
/* globals for Windows things
*/
# ifndef W3WIN_C
extern HANDLE g_hInstance;
extern HWND g_hWnd;
extern HDC g_hDC;
extern int g_nLineHeight, g_nCharWidth;
extern UINT g_idTimer;
extern int g_caret_x, g_caret_y;
extern HFONT g_hfont;
extern HFONT g_oldFont;
extern BOOL g_caret;
extern BOOL g_hasFocus;
extern char *g_APPNAME;
extern BOOL g_menu;
extern BOOL edInited;
#endif /* W3WIN_C */
/* function macros
*/
#define IsCaretCreated() (g_caret & 1)
#define IsCaretVis() ((g_caret & 2) && IsCaretCreated())
#define SetCaretCreated(flg) {if (flg) g_caret |= 1; else g_caret &= ~1;}
#define MakeCaretVis(flg) {if (flg) g_caret |= 2; else g_caret &= ~2;}
#define SetCaretVis(flg)\
{\
if (flg && !IsCaretVis() && !IsIconic(g_hWnd)) \
DoShowCaret(g_hWnd);\
else if (!flg && IsCaretVis())\
DoHideCaret(g_hWnd);\
}
# endif /* MSW */
/* wwwwwwwwwwwwwwwwwwwwwwwwww Windows 3.+ / NT wwwwwwwwwwwwwwwwwwwwwwwwwwww */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx X11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
*/
# ifdef X11
# define SomeUnix
# ifdef SUN
# define sun
# endif
# define WINDOWED /* windowed terminal device */
# include "Xmd.h"
# include "Xlib.h"
# include "Xutil.h"
# include "cursorfont.h"
# define NROW 300 /* Max Rows. */
# define NCOL 200 /* Max Columns. */
# define TIME_INC (120000) /* 1/4 sec in microsecs */
# define INCS_PER_UPDATE (1) /* used for window title update */
# define INCS_PER_SLEEP 3
# define INCS_PER_SEC 6
# define INCS_PER_SAVE (INCS_PER_SEC * 6) /* IncrementalSave every N secs */
# define SAVE_DELAY INCS_PER_SAVE
# define DELAY_TO_SCROLL 0 /* fast as possible */
typedef struct
{int top, bottom, left, right;} RECT; /* WINDOW's lookalike */
typedef int HANDLE;
typedef int WPARAM;
typedef int HWND;
typedef long LPARAM;
typedef unsigned int UINT;
typedef int WORD;
typedef long COLORREF;
# ifndef BOOL
# define BOOL int
# endif /* BOOL */
# define HUGE
# ifndef XWIN_C
extern Display *gDpy;
extern Window gWindow;
extern XFontStruct *gFont;
extern XCharStruct *gXchar;
extern GC gText; /* for drawing text */
extern GC gTouchedText;/* for drawing touched text */
extern GC gMode; /* for drawing modeline */
extern GC gXor; /* for cursor */
extern char *g_APPNAME;
extern int g_nLineHeight, g_nCharWidth, g_nLineAscent;
extern int g_caret_x, g_caret_y;
extern BOOL g_caret;
extern BOOL g_hasFocus;
extern BOOL edInited;
# endif /* XWIN_C */
/* function macros
*/
#define IsCaretCreated() (g_caret & 1)
#define IsCaretVis() ((g_caret & 2) && IsCaretCreated())
#define SetCaretCreated(flg) {if (flg) g_caret |= 1; else g_caret &= ~1;}
#define MakeCaretVis(flg) {if (flg) g_caret |= 2; else g_caret &= ~2;}
#define SetCaretVis(flg)\
{\
if (flg && !IsCaretVis()) \
DoShowCaret();\
else if (!flg && IsCaretVis())\
DoHideCaret();\
}
# define ringbell() XBell(gDpy,0)
/* These font names worked well on the instance of the following
* systems I had access to; variations of X11 R4 and R5.
* Override it on the command line, or here...
*/
# ifdef ULTRIX
# define def_fontname "term*10*"
# endif
# ifdef INTERACTIVE
# define def_fontname "cou*10*"
# endif
# ifdef SOL
# define def_fontname "6x13"
# endif
# ifdef HP
# define def_fontname "cour*12*"
# endif
# ifndef def_fontname
# define def_fontname "fixed"
# endif
# define yCharPos(y) ((y) + gXchar->ascent + 1)
# define WinWidth() (g_nCharWidth * (ncol + 1))
# define WinHeight() (g_nLineHeight * (nrow + 1))
# define NoClipping() NewClipping(0, 0, -1, -1)
# define FudgeHeight 2
# define FudgeHeight2 0
# define FudgeEdge 2
# endif /* X11 */
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx X11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
/* ddddddddddddddddddddddddddddd DOS ddddddddddddddddddddddddddddddddddddd */
/* ccccccccccccccccccccccccccccc CURSES cccccccccccccccccccccccccccccccccc */
# if defined(MSC) || defined(CURSES)
# ifdef MSC
# define FAT /* DOS FILESYSTEM STUFF */
# endif
# ifdef CURSES
# include <curses.h>
# endif
# ifndef F_OK
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
# endif
# define TIME_INC (130)
# define INCS_PER_UPDATE 10 /* used for window title update */
# define INCS_PER_SEC 8
# define INCS_PER_SLEEP 6 /* used by sleep */
# define INCS_PER_SAVE (INCS_PER_SEC * 6) /* IncrementalSave every ~N secs */
# define SAVE_DELAY INCS_PER_SAVE
# define DELAY_TO_SCROLL 0 /* fast as possible */
/* moved from ttydef.h - NOTE presumes that GOSLING is not defined
* for MSW platform else NROW makes VIDEO struct overflow
* 64k array size (pukie segmented machines!)
*/
# ifdef MSC
# define NROW 60 /* Max Rows. */
# define NCOL 130 /* Max Columns. */
# else
# define NROW 300
# define NCOL 200
# endif
# define IsCaretCreated()
# define IsCaretVis() FALSE
# define SetCaretCreated(flg)
# define SetCaretVis(flg)
# define HUGE
typedef int HANDLE;
typedef int WPARAM;
typedef long LPARAM;
typedef unsigned int UINT;
typedef int WORD;
typedef int HWND;
typedef long COLORREF;
typedef struct
{int top, bottom, left, right;} RECT; /* WINDOW's lookalike */
# ifndef BOOL
# define BOOL int
# endif /* BOOL */
# endif /* MSC */
/* ddddddddddddddddddddddddd DOS dddddddddddddddddddddddddddddddddddd */
/* ccccccccccccccccccccccccccccc CURSES cccccccccccccccccccccccccccccccccc */
/* %%%%%%%%%%%%%%%%%%%%%%% System independent things %%%%%%%%%%%%%%%%%%%%% */
/* moved from def.h
*/
#define CNONE 0 /* Unknown color. */
#define CTEXT 1 /* Text color. */
#define CMODE 2 /* Mode line color. */
#ifdef WINDOWED /* not bothering with DOS or terminal based.. */
# define CHIGH 3 /* Special color */
#else
# define CHIGH CTEXT /* Special color */
#endif
#define START_COLS 80
#define START_LINES 25
#define MIN_FNAME_CHARS 6
#define MAX_FNAME_CHARS 40 /* max chars of fname in mode line */
extern char *g_APPNAME;
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% System defs %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */
/* Define this if you want the filename of each buffer in the
* mode line
*/
#define SHOWFILENAME